import "./rich-text.uniapp-sfc.css";
import { computed, defineComponent } from "vue";
import MpHtml from "./mp-html/mp-html.js";
import { createNamespace } from "../utils";
const __vue_sfc__ = defineComponent({
  name: createNamespace("RichText")[0],
  options: {
    // https://uniapp.dcloud.io/matter.html#mp
    virtualHost: true
  },
  components: { MpHtml },
  props: {
    // html 字符串
    content: String
  },
  setup(props) {
    const isHtml = computed(() => {
      const reg = /<[^>]+>/g;
      return reg.test(props.content || "");
    });
    return { isHtml };
  }
});
import { resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
function __vue_render__(_ctx, _cache) {
  const _component_MpHtml = _resolveComponent("MpHtml");
  return _openBlock(), _createElementBlock(
    "view",
    {
      class: _normalizeClass(["fan-rich-text", { pre: !_ctx.isHtml }])
    },
    [
      _createVNode(_component_MpHtml, {
        content: _ctx.content,
        "lazy-load": "",
        selectable: "",
        "show-img-menu": ""
      }, null, 8, ["content"])
    ],
    2
    /* CLASS */
  );
}
__vue_sfc__.render = __vue_render__;
var stdin_default = __vue_sfc__;
export {
  stdin_default as default
};
